package com.fare.taluo.vo.core;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang3.time.DateUtils;

public class VersionInfoVO {
	private Long versionId;
	private String versionNumber;
	private String publisher;
	private Date publishTime;
	private Long creater;
	private Date createTime;
	private int flgDeleted;

	private String publishTime_str;

	public String getPublishTime_str() {
		if (publishTime != null) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			return sdf.format(publishTime);
		} else {
			return publishTime_str;
		}
	}

	public void setPublishTime_str(String publishTime_str) {
		this.publishTime_str = publishTime_str;
	}

	private List<VersionDetailInfoVO> versionDetailInfoVOs = new ArrayList<VersionDetailInfoVO>();

	public List<VersionDetailInfoVO> getVersionDetailInfoVOs() {
		return versionDetailInfoVOs;
	}

	public void setVersionDetailInfoVOs(
			List<VersionDetailInfoVO> versionDetailInfoVOs) {
		this.versionDetailInfoVOs = versionDetailInfoVOs;
	}

	public Long getVersionId() {
		return versionId;
	}

	public void setVersionId(Long versionId) {
		this.versionId = versionId;
	}

	public Long getCreater() {
		return creater;
	}

	public void setCreater(Long creater) {
		this.creater = creater;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public int getFlgDeleted() {
		return flgDeleted;
	}

	public void setFlgDeleted(int flgDeleted) {
		this.flgDeleted = flgDeleted;
	}

	public String getVersionNumber() {
		return versionNumber;
	}

	public void setVersionNumber(String versionNumber) {
		this.versionNumber = versionNumber;
	}

	public String getPublisher() {
		return publisher;
	}

	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}

	public Date getPublishTime() {
		return publishTime;
	}

	public void setPublishTime(Date publishTime) {
		this.publishTime = publishTime;
	}

	public boolean isNewPublish(){
		return this.getPublishTime().after(DateUtils.addDays(new Date(), -7));
	}
}
